#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n, k; cin >> n >> k;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(a.begin(), a.end());
	int mx = 0;
	for (int i = 0, j = 0; i < n; i++) {
		while (j < n && a[j] - a[i] <= k) j++;
		mx = max(mx, j - i);
	}
	cout << 1.0 * mx / n << endl;
	return 0;
}